﻿Module modCommon
    Public dbConn As New OleDb.OleDbConnection
    Public dbConnSQL As New OleDb.OleDbConnection
    Public dbSrc As String
    Public prdCdChangeActionOn As Boolean '## 콤보박스 변경시 값 로딩 여부 결정
    Public gSeqsOnBill As String = ""           '## 거래명세서 발행을 위해 필요
    Public gAmountOnBill As Double = 0       '## 거래명세서 발행을 위해 필요
    Public gCompCdOnBill As Integer = 0      '## 거래명세서 발행을 위해 필요
    Public gSessionKey As String = ""            '## 출고 정보를 위한 세션키
    Public gVerNo As String = "0.145"
    Public gVersion As String = "현재 Ver. " + gVerNo
    Public gLatestVersion As String
    Public gMyDir As String = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/inventoryMan"

    '## 환경설정 전역변수
    Public gBackupTerms As Integer = 7
    Public gBackupDir As String = Application.StartupPath & "\data\backup"
    Public gDataFile As String = Application.StartupPath & "\data\dbInventory.MDB"
    Public gOCompNm As String = ""
    Public gOCompNo As String = ""
    Public gOOwner As String = ""
    Public gOAddr1 As String = ""
    Public gOAddr2 As String = ""
    Public gOTypes As String = ""
    Public gOArticle As String = ""
    Public gOPhone As String = ""
    Public gOFax As String = ""
    Public gOMajor As String = ""
    Public gOEmail As String = ""

    Public Sub dbConnection()
        dbSrc = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = " & gDataFile
        dbConn.ConnectionString = dbSrc
        dbConn.Open()
    End Sub
    Public Sub dbSqlConnection()
        dbSrc = "provider=sqloledb;server=inventory.jadesoft.co.kr;database=noahtech;uid=noahtech;pwd=shdkxpr7;"
        'MsgBox(dbSrc)
        dbConnSQL.ConnectionString = dbSrc
        dbConnSQL.Open()
    End Sub

    '## 문자열에 '체크하여 처리
    Public Function gFnChkVal(val As String) As String
        If val <> "" Then
            val = val.Replace("'", "''")
        End If
        Return val
    End Function

    '## 실시간 코마 찍기
    Public Sub gSubWithComma(ByVal obj As Object)
        Try
            If obj.text <> "" Then
                obj.Text = Format(CInt(obj.Text), "#,##0")
                obj.SelectionStart = obj.Text.Length
            End If
        Catch err As OverflowException
            'MsgBox(err.Message, MsgBoxStyle.Critical, "오류")
        End Try
    End Sub

    '## 삭제 여부 콤보박스 만들기
    Public Sub gSubMkCmbFlag(ByVal obj As Object)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter

        'Call dbConnection()

        sql = "SELECT itemCd, itemNm FROM tblComCode WHERE flag='Y' AND groupCd='0002' ORDER BY itemSeq"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "cmbFlag")

        dbConn.Close()
        With obj
            .DataSource = dsCommon.Tables("cmbFlag")
            .DisplayMember = "itemNm"
            .ValueMember = "itemCd"
            .SelectedIndex = 0
        End With
    End Sub

    '## 거래처/회원 유효 여부 콤보박스 만들기
    Public Sub gSubMkCmbMemFlag(ByVal obj As Object)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter

        Call dbConnection()

        sql = "SELECT itemCd, itemNm FROM tblComCode WHERE flag='Y' AND groupCd='0011' ORDER BY itemSeq"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "cmbMemFlag")

        dbConn.Close()
        With obj
            .DataSource = dsCommon.Tables("cmbMemFlag")
            .DisplayMember = "itemNm"
            .ValueMember = "itemCd"
            .SelectedIndex = 0
        End With
    End Sub

    '## 거래처 가져오기
    Public Sub gSubMkCmbCompany(ByVal val As String, ByVal obj As Object)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim addSql As String = ""

        'Call dbConnection()

        If val <> "" Then
            addSql = "WHERE company LIKE '%" + val + "%' AND flag='Y' "
        End If
        sql = "SELECT company+'('+compNo+')' as compInfo, compCd FROM tblCompany " + addSql + " ORDER BY company"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "comp")

        dbConn.Close()
        Dim newDsRow As DataRow = dsCommon.Tables("comp").NewRow
        newDsRow("compInfo") = "-거래처-"
        newDsRow("compCd") = "0"

        dsCommon.Tables("comp").Rows.Add(newDsRow)

        Try
            With obj
                .DataSource = dsCommon.Tables("comp")
                .DisplayMember = "compInfo"
                .ValueMember = "compCd"
                '.SelectedIndex = 0
            End With
            If addSql = "" Then
                obj.SelectedIndex = dsCommon.Tables("comp").Rows.Count - 1
            End If
        Catch err As NullReferenceException
            MsgBox(err.Message)
        End Try
    End Sub

    '## 계정 정보 가져오기
    Public Sub gSubMkCmbAccount(ByVal obj As Object, ByVal flag As String)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim addSql As String = ""
        sql = "SELECT accountNm, accountCd FROM tblAccount WHERE flag='Y' AND [part]='" + flag + "' ORDER BY accountNm"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "cmbAccGroup")

        dbConn.Close()
        Dim newDsRow As DataRow = dsCommon.Tables("cmbAccGroup").NewRow
        newDsRow("accountNm") = "-계정-"
        newDsRow("accountCd") = "0"

        dsCommon.Tables("cmbAccGroup").Rows.Add(newDsRow)
        With obj
            .DataSource = dsCommon.Tables("cmbAccGroup")
            .DisplayMember = "accountNm"
            .ValueMember = "accountCd"
        End With
        obj.SelectedIndex = dsCommon.Tables("cmbAccGroup").Rows.Count - 1
    End Sub

    '## 제품 가져오기
    Public Sub gSubMkCmbProduct(ByVal val As String, ByVal obj As Object)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim addSql As String = ""
        prdCdChangeActionOn = False
        'Call dbConnection()
        If val <> "" Then
            prdCdChangeActionOn = True
            addSql = "WHERE prdNm LIKE '%" + val + "%' AND flag='Y' "
        End If
        sql = "SELECT prdNm as product, prdCd FROM tblProduct " + addSql + " ORDER BY prdNm"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "PRD")
        dbConn.Close()

        Dim newDsRow As DataRow = dsCommon.Tables("PRD").NewRow
        newDsRow("product") = "-제품-"
        newDsRow("prdCd") = "0"

        dsCommon.Tables("PRD").Rows.Add(newDsRow)

        Try
            With obj
                .DataSource = dsCommon.Tables("PRD")
                .DisplayMember = "product"
                .ValueMember = "prdCd"
                '.SelectedIndex = 0
            End With
            If addSql = "" Then
                obj.SelectedIndex = dsCommon.Tables("PRD").Rows.Count - 1
            End If
        Catch err As NullReferenceException
            MsgBox(err.Message)
        End Try
        prdCdChangeActionOn = True
    End Sub

    '## 결재 수단 
    Public Sub gSubMkCmbPayMethod(ByVal obj As Object)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        'Call dbConnection()
        sql = "SELECT itemNm, itemCd FROM tblComCode WHERE flag='Y' AND groupCd='0006' ORDER BY itemSeq"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "cmbPayMethod")

        dbConn.Close()
        Dim newDsRow As DataRow = dsCommon.Tables("cmbPayMethod").NewRow
        newDsRow("itemNm") = "-결재방법-"
        newDsRow("itemCd") = "0"

        dsCommon.Tables("cmbPayMethod").Rows.Add(newDsRow)
        With obj
            .DataSource = dsCommon.Tables("cmbPayMethod")
            .DisplayMember = "itemNm"
            .ValueMember = "itemCd"
        End With
        obj.SelectedIndex = dsCommon.Tables("cmbPayMethod").Rows.Count - 1
    End Sub

    '## 자료 보유 년도
    Public Sub gSubMkCmbYear(ByVal obj As Object)
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        'Call dbConnection()
        sql = "SELECT Yr FROM tblStatistics GROUP BY Yr ORDER BY Yr DESC"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "cmbYear")

        dbConn.Close()
        Dim newDsRow As DataRow = dsCommon.Tables("cmbYear").NewRow
        newDsRow("Yr") = "-전체-"

        dsCommon.Tables("cmbYear").Rows.Add(newDsRow)
        With obj
            .DataSource = dsCommon.Tables("cmbYear")
            .DisplayMember = "Yr"
            .ValueMember = "Yr"
        End With
        'obj.SelectedIndex = dsCommon.Tables("cmbYear").Rows.Count - 1
        obj.SelectedIndex = 0
    End Sub

    '## 신규 매출의 IncCd 구하기
    Public Function gFnGetIncCd() As String
        Dim sql As String
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim maxIncCd As String
        sql = "SELECT max(incCd)+1 as maxIncCd FROM tblIncome"
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "maxIncCd")

        'dbConn.Close()
        maxIncCd = dsCommon.Tables("maxIncCd").Rows(0).Item(0)

        Return maxIncCd
    End Function

    '## 제품별 재고 조사
    Public Sub gLookupInventory(ByVal prdCd As String, ByVal msgMode As String)

        If prdCd = "" Then
            MsgBox("제품코드를 바르게 입력해 주세요")
            Exit Sub
        End If
        Dim restCnt As String = "0"
        Dim oleCmd As OleDb.OleDbCommand
        Dim oleTran As OleDb.OleDbTransaction
        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim rtnMsg, sql As String
        sql = "SELECT sum([input])-sum([output]) as rest FROM tblPrdInOut WHERE prdCd=" + prdCd + " AND flag='Y'"

        Call dbConnection()
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "PrdInventory")


        If IsDBNull(dsCommon.Tables("PrdInventory").Rows(0).Item(0)) = False Then
            restCnt = dsCommon.Tables("PrdInventory").Rows(0).Item(0)
        End If

        sql = "UPDATE tblProduct SET inventoryCnt=" + restCnt + " WHERE prdCd=" + prdCd
        rtnMsg = "재고 조사가 완료 되었습니다."
        oleCmd = New OleDb.OleDbCommand(sql, dbConn)

        oleTran = dbConn.BeginTransaction
        oleCmd.Transaction = oleTran
        Try

            oleCmd.ExecuteNonQuery()
            oleTran.Commit()

            dbConn.Close()
            If msgMode = "" Then
                MsgBox(rtnMsg)
            End If
        Catch err As OleDb.OleDbException
            oleTran.Rollback()
            dbConn.Close()
            MsgBox(sql)

            MsgBox(err.Message, MsgBoxStyle.Critical, "오류")
        End Try
    End Sub

    '## 제품 단가 구하는 함수
    Public Function gFnUnitPrice(ByVal BCFlag As String, ByVal prdCd As String) As String

        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim sql, unitPrice As String
        sql = "SELECT unit" + BCFlag + "Price FROM tblProduct WHERE prdCd=" + prdCd
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "prdUintPrice")

        unitPrice = dsCommon.Tables("prdUintPrice").Rows(0).Item(0)
        unitPrice = Format(CInt(unitPrice), "#,##0")

        Return unitPrice
    End Function

    '## 박스당 갯수 구하는 함수
    Public Function gFnEaOnBox(ByVal qty As String, ByVal prdCd As String) As String

        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim sql, eaOnBox As String
        sql = "SELECT box2Ea FROM tblProduct WHERE prdCd=" + prdCd
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(sql, dbConn)
        daCommon.Fill(dsCommon, "prdEaOnBox")

        eaOnBox = dsCommon.Tables("prdEaOnBox").Rows(0).Item(0)
        eaOnBox = CInt(qty) * CInt(eaOnBox)
        eaOnBox = Format(CInt(eaOnBox), "#,##0")

        Return eaOnBox
    End Function

    '## 쿼리에 대한 하나의 값 반환하기
    Public Function gAFieldValue(ByVal query As String) As String

        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter
        Dim rtnValue As String
        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(query, dbConn)
        daCommon.Fill(dsCommon, "aFieldValue")

        'dbConn.Close()
        rtnValue = dsCommon.Tables("aFieldValue").Rows(0).Item(0)

        Return rtnValue
    End Function

    '## 쿼리를 저장하는 함수
    Public Sub gSubSaveAction(ByVal query As String, ByVal msg As String)

        Dim oleCmd As OleDb.OleDbCommand
        Dim oleTran As OleDb.OleDbTransaction
        oleCmd = New OleDb.OleDbCommand(query, dbConn)

        oleTran = dbConn.BeginTransaction
        oleCmd.Transaction = oleTran
        Try

            oleCmd.ExecuteNonQuery()
            oleTran.Commit()

            If msg <> "" Then
                MsgBox(msg)
            End If
        Catch err As OleDb.OleDbException
            oleTran.Rollback()
            dbConn.Close()
            MsgBox(query)

            MsgBox(err.Message, MsgBoxStyle.Critical, "오류")
        End Try
    End Sub

    '## 쿼리에 대한 DataTable 반환하기
    Public Function gMkDataTable(ByVal query As String, ByVal tbname As String) As DataTable

        Dim dsCommon As DataSet
        Dim daCommon As OleDb.OleDbDataAdapter

        dsCommon = New DataSet
        daCommon = New OleDb.OleDbDataAdapter(query, dbConn)
        daCommon.Fill(dsCommon, tbname)

        Return dsCommon.Tables(tbname)
    End Function

    '## O/S에 따른 Icon 표시 선택
    Public Sub gSubIconShow(ByVal obj As Object)

        'Dim os As OperatingSystem = Environment.OSVersion
        'If Mid(os.ToString, 1, 22) <> "Microsoft Windows NT 5" Then
        '    obj.ShowIcon = True
        '    obj.Icon = My.Resources.inven
        'End If
    End Sub

    '## Data 백업
    Public Sub gSubDataBackup(ByVal msg As String)
        Dim srcFile, backupFile As String
        Dim curDt As String = System.DateTime.Now.ToString("yyMMdd-HHmmss")

        If (Not System.IO.Directory.Exists(gBackupDir)) Then
            System.IO.Directory.CreateDirectory(gBackupDir)
        End If

        '## 7일 지난 백업 파일 자동 삭제
        Call gSubBackupDel()

        srcFile = gDataFile 'Application.StartupPath + "/data/dbInventory.MDB"
        backupFile = gBackupDir + "/" + curDt + "_backup.IVbak"

        If System.IO.File.Exists(srcFile) = True Then
            System.IO.File.Copy(srcFile, backupFile)
        End If
        If msg <> "" Then
            MsgBox(msg)
        End If
    End Sub

    Public Sub gSubBackupDel()
        Dim di As New IO.DirectoryInfo(gBackupDir)
        Dim diFiles As IO.FileInfo() = di.GetFiles()
        Dim dra As IO.FileInfo
        Dim mkDt As String
        Dim delBackupTerms As Integer = -1 * gBackupTerms

        '## gBackupTerms 일 지난 백업 파일 자동 삭제
        Dim stdDt As String = DateAdd("d", delBackupTerms, DateTime.Today)
        stdDt = Mid(stdDt.Replace("-", ""), 3, 8)

        For Each dra In diFiles
            mkDt = dra.ToString
            mkDt = Mid(mkDt, 1, 6)
            If mkDt < stdDt Then
                System.IO.File.Delete(gBackupDir + "/" + dra.ToString)
            End If
        Next
    End Sub

    '## 그리드의 내용 엑셀로 다운로드
    Public Sub gGrid2Excel(ByVal grdNm As Object, ByVal target As String, ByVal evnt As Object, ByVal progress As Object, ByVal startColumn As Integer)
        Dim xlApp As Microsoft.Office.Interop.Excel.Application
        Dim xlWorkBook As Microsoft.Office.Interop.Excel.Workbook
        Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
        Dim misValue As Object = System.Reflection.Missing.Value
        Dim i As Integer
        Dim j As Integer

        Try
            evnt.Text = "작성중....."
            evnt.Enabled = False
            progress.Visible = True

            xlApp = New Microsoft.Office.Interop.Excel.Application
            xlWorkBook = xlApp.Workbooks.Add(misValue)
            xlWorkSheet = xlWorkBook.Sheets("sheet1")

            progress.Value = 2

            Threading.Thread.Sleep(500)
            For i = 0 To grdNm.RowCount - 1
                For j = startColumn To grdNm.ColumnCount - 1
                    For k As Integer = startColumn + 1 To grdNm.Columns.Count
                        xlWorkSheet.Cells(1, k) = grdNm.Columns(k - 1).HeaderText
                        xlWorkSheet.Cells(i + 2, j + 1) = grdNm(j, i).Value.ToString()
                    Next
                Next
                If grdNm.RowCount < 50 Then
                    If i Mod 10 = 0 Then
                        progress.Value += 20
                    End If
                ElseIf grdNm.RowCount < 100 Then
                    If i Mod 10 = 0 Then
                        progress.Value += 10
                    End If
                ElseIf grdNm.RowCount < 500 Then
                    If i Mod 10 = 0 Then
                        progress.Value += 5
                    End If
                ElseIf grdNm.RowCount < 1000 Then
                    If i Mod 10 = 0 Then
                        progress.Value += 1
                    End If
                End If
            Next

            'xlWorkSheet.SaveAs(target + "/" + xlsFile)
            progress.Value = 90
            progress.Refresh()
            Try
                Threading.Thread.Sleep(1000)
                xlWorkSheet.SaveAs(target)
                xlWorkBook.Close()
                xlApp.Quit()

                gSubReleaseObject(xlApp)
                gSubReleaseObject(xlWorkBook)
                gSubReleaseObject(xlWorkSheet)

                progress.Value = 100
                evnt.Text = "Download"
                evnt.Enabled = True
                progress.Visible = False
                Dim res As MsgBoxResult
                res = MsgBox("엑셀 다운로드가 완료 되었습니다." + vbCrLf + "파일을 여시겠습니까?", MsgBoxStyle.YesNo)
                If (res = MsgBoxResult.Yes) Then
                    'Process.Start(target + "/" + xlsFile)
                    Process.Start(target)
                End If
            Catch cx As Exception
                progress.Value = 90
                'MsgBox(cx.Message)
                xlWorkBook.Close()
                xlApp.Quit()

                gSubReleaseObject(xlApp)
                gSubReleaseObject(xlWorkBook)
                gSubReleaseObject(xlWorkSheet)
                evnt.Text = "다운로드"
                evnt.Enabled = True
                progress.Visible = False
            End Try

            progress.Value = 0
        Catch ex As NullReferenceException
            MsgBox(ex.Message)
        End Try
    End Sub

    '## 엑셀 다운로드 오브젝트 초기화
    Public Sub gSubReleaseObject(ByVal obj As Object)
        Try
            System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
            obj = Nothing
        Catch ex As Exception
            obj = Nothing
        Finally
            GC.Collect()
        End Try
    End Sub

    '## 환경설정파일 로드
    Public Sub gSubLoadConfig()

        If System.IO.File.Exists(Application.StartupPath + "/config.xml") = True Then
            ' MsgBox("exist")
            Dim config As XDocument = XDocument.Load(Application.StartupPath + "/config.xml")
            Dim compNm = From t In config.Descendants("compNm") Select t.Value
            Dim compNo = From t In config.Descendants("compNo") Select t.Value
            Dim owner = From t In config.Descendants("owner") Select t.Value
            Dim addr1 = From t In config.Descendants("addr1") Select t.Value
            Dim addr2 = From t In config.Descendants("addr2") Select t.Value
            Dim types = From t In config.Descendants("types") Select t.Value
            Dim article = From t In config.Descendants("article") Select t.Value
            Dim phone = From t In config.Descendants("phone") Select t.Value
            Dim fax = From t In config.Descendants("fax") Select t.Value
            Dim major = From t In config.Descendants("major") Select t.Value
            Dim email = From t In config.Descendants("email") Select t.Value
            Dim sourceData = From t In config.Descendants("sourceData") Select t.Value
            Dim backupPosition = From t In config.Descendants("backupPosition") Select t.Value
            Dim backupTerms = From t In config.Descendants("backupTerms") Select t.Value

            gOCompNm = compNm.First
            gOCompNo = compNo.First
            gOOwner = owner.First
            gOAddr1 = addr1.First
            gOAddr2 = addr2.First
            gOTypes = types.First
            gOArticle = article.First
            gOPhone = phone.First
            gOFax = fax.First
            gOMajor = major.First
            gOEmail = email.First
            gBackupTerms = backupTerms.First
            gBackupDir = backupPosition.First
            gDataFile = sourceData.First
        End If
    End Sub

    Public Sub gSubImportXLS(ByVal obj As Object)
        Dim opendlg As New OpenFileDialog
        Dim dsExcel As New DataSet

        opendlg.Filter = "Excel Files (*.xls)|*.xls|All Files (*.*)|*.*"

        If opendlg.ShowDialog() = Windows.Forms.DialogResult.OK Then

            Dim pathname As String = opendlg.FileName
            Dim connect As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" & "data source=" & pathname & ";Extended Properties=Excel 8.0;")

            Dim adapter As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", connect)
            Try
                connect.Open()
                adapter.Fill(dsExcel)
                Dim chkBox As New DataColumn("선택", System.Type.GetType("System.Boolean"))
                dsExcel.Tables(0).Columns.Add(chkBox)
                chkBox.SetOrdinal(0)
                obj.DataSource = dsExcel.Tables(0)

                connect.Close()
                obj.Columns(0).Width = "40"
            Catch ex As Exception
                MsgBox("Excel 파일이 열려 있거나 정상적이지 않습니다.")
            End Try

        End If
    End Sub
End Module
